﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;

namespace MvcApplication4.Models
{
    public class UserRepository
    {
        VefTVDataContext db = new VefTVDataContext();

        public IQueryable<User> GetAllUsers()
        {
            return db.Users;
        }

        public void Add(User User)
        {

        }

        public User GetUser(int UserID)
        {
            return db.Users.SingleOrDefault(s => s.Id == UserID);
        }

        public User GetUserByEmailAndPassword(string email, string password)
        {
            return db.Users.SingleOrDefault(s => s.Email == email && s.Password == password);
        }
    }
}
